package com.laicunba.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.laicunba.dao.impl.GenericQueryDAOImpl;
import com.laicunba.dao.impl.GenericUpdateDAOImpl;
import com.laicunba.pojo.BaseDO;

@Component
public class CommScriptGeneter {

	@Autowired
	private List<BaseDO> tables;

	@Autowired
	private GenericUpdateDAOImpl updateScriptGen;
	@Autowired
	private GenericQueryDAOImpl getScriptGen;

	public void doGenCommScript() {
		for (BaseDO table : tables) {
			updateScriptGen.genAutoSqlForCreate(table);
			updateScriptGen.genAutoSqlForUpdate(table);
			getScriptGen.genAutoSqlForGet(table.getClass());
		}
	}

}
